﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
namespace Ecreate.Web.utility
{
    public class OpenFile : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {

            ////从数据库中取出要下载的文件信息
            //RuixinOA.BusinessFacade.RX_OA_FileManager os = new RX_OA_FileManager();
            //EntityData data = os.GetFileDetail(id);

            //if (data != null && data.Tables["RX_OA_File"].Rows.Count > 0)
            //{
            //    DataRow dr = (DataRow)data.Tables["RX_OA_File"].Rows[0];

            //    context.Response.Buffer = true;
            //    context.Response.Clear();
            //    context.Response.ContentType = dr["CContentType"].ToString();
            //    context.Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(dr["CTitle"].ToString()));
            //    context.Response.BinaryWrite((Byte[])dr["CContent"]);
            //    context.Response.Flush();
            //    context.Response.End();
            //}


        }

        public bool IsReusable
        {

            get { return true; }
        }
    }
}
